package com.xiaotu.spider.iqy.pipeline;


import com.xiaotu.common.model.MaoYanMoviePeopleModel;
import com.xiaotu.spider.APipeline;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

public abstract class IQYIndexPipeline extends APipeline{

	@Override
	protected void doProcess(ResultItems resultItems, Task task) {
		MaoYanMoviePeopleModel people = resultItems.get(MaoYanMoviePeopleModel.class.getName());
        if (people != null)
        {
            String key = getRedisKey();
            cacheHandler.hSet(key, people.getDataId()+"_"+people.getId()+"_"+people.getResourceSiteId(), people);
            cacheHandler.setCacheTimeout(key);
        }
	}
	
	protected abstract String getRedisKey();
	
}
